package com.cndw.kungfu.model.goods.domain;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * 镶嵌奖励
 * 
 * @author <a href="mailto:whz-work@163.com">汪洪州</a>
 * 
 * @since 1.0 Create on 2011-5-30
 */
public class ModeGoodsInlay {
	/**
	 * 宝石
	 */
	private int goodsId;
	/**
	 * 加血
	 */
	private int hp;
	/**
	 * 加魔法
	 */
	private int mp;

	/**
	 * 加攻击
	 */
	private int attack;

	/**
	 * 加防御
	 */
	private int defense;

	/**
	 * 攻速
	 */
	private int speed;

	/**
	 * 宝石类型(金，木，水，火，土)
	 */
	private int type;

	private static Map<Integer, Integer> inlayGem = new HashMap<Integer, Integer>();

	private static Map<Integer, ModeGoodsInlay> inlayMap = new HashMap<Integer, ModeGoodsInlay>();

	static {

		int[][] append = { {1000, 500, 1000, 500, 30 }, 
						   {2000, 1000, 2000, 1000, 100 }, 
						   {3500, 1500, 3500, 1500, 150 }, 
						   {4500, 2000, 4500, 2000, 250 },
						   {5500, 2600, 5500, 2600, 300 }, 
						   {7000, 3000, 7000, 3000, 350 },
						   {8000, 3500, 8000, 3500, 400 }, 
						   {9500, 4000, 9500, 4000, 500 }, 
						   {12000, 5500, 12000, 5500, 800 } };
		
		int g = 103051;
		for (int i = 1; i <= 9; i++) {
			for (int m = 1; m <= 5; m++) {
				int[] value = { 0, 0, 0, 0, 0, 0 };
				value[m - 1] = append[i - 1][m - 1];
				inlayMap.put(g, new ModeGoodsInlay(g, value[0], value[1], value[2], value[3], value[4], m));
				g++;
			}
		}

		inlayGem.put(1, 1000);
		inlayGem.put(2, 2000);
		inlayGem.put(3, 4000);
		inlayGem.put(4, 6000);
		inlayGem.put(5, 8000);
		inlayGem.put(6, 10000);
		inlayGem.put(7, 12000);
		inlayGem.put(8, 15000);
		inlayGem.put(9, 20000);
	}

	private ModeGoodsInlay(int goodsId, int hp, int attack, int mp, int defense, int speed, int type) {
		this.goodsId = goodsId;
		this.hp = hp;
		this.attack = attack;
		this.mp = mp;
		this.defense = defense;
		this.speed = speed;
		this.type = type;
	}
	
	public ModeGoodsInlay(){
		
	}

	public static Integer getRequiredMoney(int level) {
		return inlayGem.get(level);
	}

	public static ModeGoodsInlay get(int goodsId) {
		return inlayMap.get(goodsId);
	}

	public static Map<Integer, ModeGoodsInlay> getInlayMap() {
		return inlayMap;
	}

	public int getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(int goodsId) {
		this.goodsId = goodsId;
	}

	public int getHp() {
		return hp;
	}

	public void setHp(int hp) {
		this.hp = hp;
	}

	public int getMp() {
		return mp;
	}

	public void setMp(int mp) {
		this.mp = mp;
	}

	public int getAttack() {
		return attack;
	}

	public void setAttack(int attack) {
		this.attack = attack;
	}

	public int getDefense() {
		return defense;
	}

	public void setDefense(int defense) {
		this.defense = defense;
	}

	public int getSpeed() {
		return speed;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

}
